package com.atguigu.tingshu.account.service;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.account.UserAccount;
import com.atguigu.tingshu.vo.account.AccountLockResultVo;
import com.atguigu.tingshu.vo.account.AccountLockVo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;

public interface UserAccountService extends IService<UserAccount> {


    /**
     * 远程调用账号微服务,校验账户的余额是否充足,并且锁定账户的余额
     * @param accountLockVo
     * @return
     */
    Result<AccountLockResultVo> checkAndLockUserAccount(AccountLockVo accountLockVo);

    /**
     * 记录流水
     * @param userId
     * @param title
     * @param tradeType
     * @param amount
     * @param orderNo
     */
    public void log(Long userId, String title, String tradeType, BigDecimal amount, String orderNo);
}
